<template>
	<view class="container2">
		<view class="square1">
			<view class="subname">{{SubName}}</view>
		</view>
		<view class="square1">
			<view v-html="Expand.Context"></view> 
		</view>
		<view class="square1">
			<view class="line2"><view class="name">简要案情及处罚内容：</view><view class="text indent">{{Item.T60_Brief}}</view></view>
			<view class="line2"><view class="name">当事人申请延期(分期)缴纳罚款的理由：</view><view class="text indent">{{Item.T60_Reason}} </view></view>
			<view class="line2"><view class="name">承办人意见：</view><view class="text indent">{{Item.T60_CBRYJ}} </view></view>
			<view class="line3">
				<view class="redbd"><view class="top">{{Item.ZBRRealName}}</view><view class="bottom">{{Item.ZBRLawNum}}</view></view>
				<view class="redbd"><view class="top">{{Item.XBRRealName}}</view><view class="bottom">{{Item.XBRLawNum}}</view></view>
				<template v-if="Item.XBRRealName2!=''">
					<view class="redbd"><view class="top">{{Item.XBRRealName2}}</view><view class="bottom">{{Item.XBRLawNum2}}</view></view>
				</template>
				<template v-if="Item.XBRRealName3!=''">
					<view class="redbd"><view class="top">{{Item.XBRRealName3}}</view><view class="bottom">{{Item.XBRLawNum3}}</view></view>
				</template>
				<view class="text right">{{Tools.ToDateStr(Item.T60_CBRYJ_Date)}}</view>
			</view>
			<view class="line2"><view class="name">承办机构审核意见：</view><view class="text indent">{{Item.T60_CBZDYJ_IsAgree+Item.T60_CBZDYJ_Reason}} </view></view>
			<view class="line3" v-if="Item.T60_CBZDYJ_IsAgree!=''">
				<view class="redbd"><view class="top">{{Tools.FindRealName(Item)}}</view><view class="bottom">{{Tools.FindLawNum(Item)}}</view></view>
				<view class="text right">{{Tools.ToDateStr(Item.T60_CBZDYJ_Date)}}</view>
			</view>
			<view class="line2"><view class="name">行政机关负责人审批意见：</view><view class="text indent">{{Item.T60_XZJGFZRSPYJ_IsAgree}} </view></view>
			<view class="line3" v-if="Item.T60_XZJGFZRSPYJ_IsAgree!=''"><view class="signname"><image src="/static/guochunsheng.png" mode="heightFix" /></view><view class="text right">{{Tools.ToDateStr(Item.T60_XZJGFZRSPYJ_Date)}}</view></view>
		</view>
		<view class="square2" v-if="Item.State<3">
			<form @submit="formSubmit">
				<view :class="RoleID==1 && (Item.T60_AuditRoleID==1 || Item.T60_AuditRoleID==2)?'':'hidden'">
					<view class="cu-form-group border-b">
						<view class="longtitle">承办人意见</view>
						<view class="text">
							<textarea name="T60_CBRYJ" placeholder="输入延期（分期）缴纳罚款的具体建议" :value="Item.T60_CBRYJ"></textarea>
						</view>
					</view>
					<view class="cu-form-group border-b">
						<view class="title">选择日期</view>
						<view class="text">
							<picker name="T60_CBRYJ_Date" mode="date" :value="Tools.ToDate(Item.T60_CBRYJ_Date,'请选择日期')" @change="T60_CBRYJ_Date_Change">
								<view class="uni-input">{{Tools.ToDate(Item.T60_CBRYJ_Date,'请选择日期')}}</view>
							</picker>
							<view class="clear" @click="T60_CBRYJ_Date_Clear"></view>
						</view>
					</view>
					<button class="publish" form-type="submit">确定</button>
				</view>
				<view :class="RoleID==2 && (Item.T60_AuditRoleID==2 || Item.T60_AuditRoleID==7)?'':'hidden'">
					<view class="cu-form-group border-b">
						<view class="title">审核意见</view>
						<view class="text">
							<picker :value="Tools.findStringIndex(List2,Item.T60_CBZDYJ_IsAgree)" :range="List2" @change="T60_CBZDYJ_IsAgree_Change">
								<view class="uni-input">
									{{List2[Tools.findStringIndex(List2,Item.T60_CBZDYJ_IsAgree)]}}<input name="T60_CBZDYJ_IsAgree" type="text" class="hidden" :value="List2[Tools.findStringIndex(List2,Item.T60_CBZDYJ_IsAgree)]"/>
								</view>
							</picker>
						</view>
					</view>
					<view class="cu-form-group border-b" v-if="Item.T60_CBZDYJ_IsAgree=='不同意，理由：'">
						<view class="longtitle">填写理由</view>
						<view class="text">
							<textarea name="T60_CBZDYJ_Reason" placeholder="输入理由" :value="Item.T60_CBZDYJ_Reason"></textarea>
						</view>
					</view>
					<view class="cu-form-group border-b">
						<view class="title">选择日期</view>
						<view class="text">
							<picker name="T60_CBZDYJ_Date" mode="date" :value="Tools.ToDate(Item.T60_CBZDYJ_Date,'请选择日期')" @change="T60_CBZDYJ_Date_Change">
								<view class="uni-input">{{Tools.ToDate(Item.T60_CBZDYJ_Date,'请选择日期')}}</view>
							</picker>
							<view class="clear" @click="T60_CBZDYJ_Date_Clear"></view>
						</view>
					</view>
					<button class="publish" form-type="submit">确定</button>
				</view>
				<view :class="RoleID==7 && (Item.T60_AuditRoleID==7 || Item.T60_AuditRoleID==0)?'':'hidden'">
					<view class="cu-form-group border-b">
						<view class="title">审批意见</view>
						<view class="text">
							<picker :value="Tools.findStringIndex(List7,Item.T60_XZJGFZRSPYJ_IsAgree)" :range="List7" @change="T60_XZJGFZRSPYJ_IsAgree_Change">
								<view class="uni-input">
									{{List7[Tools.findStringIndex(List7,Item.T60_XZJGFZRSPYJ_IsAgree)]}}<input name="T60_XZJGFZRSPYJ_IsAgree" type="text" class="hidden" :value="List7[Tools.findStringIndex(List7,Item.T60_XZJGFZRSPYJ_IsAgree)]"/>
								</view>
							</picker>
						</view>
					</view>
					<view class="cu-form-group border-b">
						<view class="title">选择日期</view>
						<view class="text">
							<picker name="T60_XZJGFZRSPYJ_Date" mode="date" :value="Tools.ToDate(Item.T60_XZJGFZRSPYJ_Date,'请选择日期')" @change="T60_XZJGFZRSPYJ_Date_Change">
								<view class="uni-input">{{Tools.ToDate(Item.T60_XZJGFZRSPYJ_Date,'请选择日期')}}</view>
							</picker>
							<view class="clear" @click="T60_XZJGFZRSPYJ_Date_Clear"></view>
						</view>
					</view>
					<button class="publish" form-type="submit">确定</button>
				</view>
			</form>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ID:0,
				RoleID:0,
				Item:{ID:0},
				SubName:'',
				Expand:{},
				List2:['选择审核意见'],
				List7:['选择审批意见'],
			};
		},
		onLoad(options) {
			uni.setNavigationBarTitle({title:options.SubName});
			this.SubName=options.SubName;
			this.ID=options.ID;
			this.RoleID=uni.getStorageSync("RoleID");
			this.Find_CaseInfo();
			this.List2.push("拟同意");
			this.List2.push("不同意，理由：");
			this.List7.push("同意");
			this.List7.push("不同意");
		},
		methods:{
			//承办人
			T60_CBRYJ_Date_Change(e){
				this.Item.T60_CBRYJ_Date=e.detail.value;
			},
			//承办机构
			T60_CBZDYJ_IsAgree_Change(e){
				this.Item.T60_CBZDYJ_IsAgree=this.List2[e.detail.value];
			},
			T60_CBZDYJ_Date_Change(e){
				this.Item.T60_CBZDYJ_Date=e.detail.value;
			},
			//行政机关负责人
			T60_XZJGFZRSPYJ_IsAgree_Change(e){
				this.Item.T60_XZJGFZRSPYJ_IsAgree=this.List7[e.detail.value];
			},
			T60_XZJGFZRSPYJ_Date_Change(e){
				this.Item.T60_XZJGFZRSPYJ_Date=e.detail.value;
			},
			T60_CBRYJ_Date_Clear(e){
				this.Item.T60_CBRYJ_Date='';
			},
			T60_CBZDYJ_Date_Clear(e){
				this.Item.T60_CBZDYJ_Date='';
			},
			T60_XZJGFZRSPYJ_Date_Clear(e){
				this.Item.T60_XZJGFZRSPYJ_Date='';
			},
			Find_CaseInfo(){
				var data = {};
				data.Act="Find_CaseInfo";
				data.ID=this.ID;
				data.Method="T60";
				this.Util.Loading("加载中...");
				this.Util.Post2(data, json=>{
					uni.hideLoading();
					uni.stopPullDownRefresh();
					uni.hideNavigationBarLoading();
					this.Item = json.Data.Info;
					this.Expand=json.Data.Expand;
				});
			},
			formSubmit(e){
				this.Util.Confirm("是否确定？",res=>{
					var data = e.detail.value;
					data.Act="Save_T60";
					data.ID=this.ID;
					// if(data.Name.trim()==""){
					// 	this.Util.Toast("请输入机会名称");
					// 	return;
					// }
					this.Util.Loading("请稍候...");
					this.Util.Post2(data, json=>{
						this.Util.HideLoading();
						if(json.State){
							this.Util.Toast(json.Msg, obj=>{
								uni.$emit("Success");
								uni.navigateBack({delta:2});
							});
						}else{
							this.Util.Alert(json.Msg);
						}
					});
				});
			}
		}
	}
</script>

<style lang="scss">
</style>
